package com.tn.wservice.validator;

import java.util.List;

public class ValidationEngine {
	
	private List<IValidator> validators;

	public IValidationResult applyValidations(Object bo) throws Exception {
		IValidationResult validationResult = new ValidationResultImp();
		for (IValidator val : getValidators()) {
			validationResult.merge(val.validate(bo));
		}
		return validationResult;
	}

	public void setValidators(List<IValidator> validators) {
		this.validators = validators;
	}

	public List<IValidator> getValidators() {
		return validators;
	}

}
